package com.sclimin.pickerview.demo;

import com.sclimin.pickerview.PickerAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * 作者：limin
 * <p>
 * 创建时间：2019/1/23
 */
public class AnimalAdapter implements PickerAdapter<Animals> {

    private final ArrayList<Animals> mAnimals = new ArrayList<>();

    @Override
    public int getItemCount() {
        return mAnimals.size();
    }

    @Override
    public Animals getItem(int index) {
        return mAnimals.get(index);
    }

    @Override
    public String getTitle(Animals animals) {
        return animals.getName();
    }
}
